<template>
    <el-dialog  title="物流详情"
                :visible.sync="message"
                @close="resetFields"
                :show-close="false"
                width="40%">
        <span>
<!--            时间线-->
            <el-timeline style="width: 50%">
                <el-timeline-item
                            v-for="(activity, index) in progressInfo"
                            :key="index"
                            :timestamp="activity.time">
                            {{activity.context}}
                 </el-timeline-item>
            </el-timeline>
        </span>
        <!--        对话框底部-->
        <span slot="footer" class="dialog-footer">
            <el-button @click="quit">取 消</el-button>
            <el-button type="primary" @click="editOrder">确 定</el-button>
        </span>
    </el-dialog>
</template>

<script>
    import {getProInfo} from "../../../network/order";

    export default {
        name: "ProgressDia",
        props:{
            message:{
                type:Boolean,
                default(){
                    return false
                }
            }
        },
        data(){
            return {
                progressInfo:[]
            }
        },
        methods:{
            resetFields(){
                this.$refs.orderRef.resetFields()
            },
            quit(){
                this.$bus.$emit('progressOrder');
            },
            editOrder(){
                this.$bus.$emit('progressOrder');
            },
            getProInfoM(){
                getProInfo().then(res => {
                    if (res.data.meta.status !== 200){
                        this.$message.error(res.data.meta.msg)
                    }
                    this.progressInfo = res.data.data;
                })
            }
        },
        mounted() {
            this.getProInfoM()
        }
    }
</script>

<style scoped>

</style>